#include "stdafx.h"
#include "process.h"

	void Processor::
go(IplImage *image) {
	
	int nl= image->height;
	int nc= image->width * image->nChannels;
	int step= image->widthStep; 
		  
	unsigned char *data= reinterpret_cast<unsigned char *>(image->imageData);

	for (int i=1; i<nl; i++) {
		for (int j=0; j<nc; j+= image->nChannels) {

		// process each pixel ---------------------
			
			data[j]= data[j]/div * div + div/2;
			data[j+1]= data[j+1]/div * div + div/2;
			data[j+2]= data[j+2]/div * div + div/2;

		// end of pixel processing ----------------

		} // end of line
			  
		data+= step;  // next line
	}
}

